package com.itheima.stock.config;

import com.itheima.stock.properties.IdWorkersProperties;
import com.itheima.stock.util.IdWorkers;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * ClassName: PasswordEncoderConfiguration
 * Package: com.itheima.stock.config
 * Description: id 生成器
 *
 * @Author Lee
 * @Create 2024/10/30
 */
@Configuration
public class IdWorkersConfiguration {


    @Bean
    public IdWorkers idWorkers(IdWorkersProperties properties) {
        return new IdWorkers(properties.getMachineId(), properties.getDatacenterId());
    }
}
